package com.lychee.binderdemo;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Lychee of on 2017/10/24 18:29.
 * <p>
 * Author: Hejingzhou
 * <p>
 * Email: tcowork@163.com
 */
public class User implements Parcelable {


    private String nickName;
    private String password;

    public User() {
    }

    public User(String nickName, String password) {
        this.nickName = nickName;
        this.password = password;
    }

    protected User(Parcel in) {
        nickName = in.readString();
        password = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(nickName);
        dest.writeString(password);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
